<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org" xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity3">
<head th:replace="top::html" />
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>AdminLTE 2 | Starter</title>
<!-- Tell the browser to be responsive to screen width -->
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">

<body class="fixed hold-transition skin-blue">
    <div class="wrapper">

        <!-- Main Header -->
        <div th:replace="tophtml::html"></div>
        <!-- Left side column. contains the logo and sidebar -->
        <div th:replace="left::html"></div>

        <!-- Content Wrapper. Contains page content -->
        <div class="content-wrapper">
            <!-- Content Header (Page header) -->
            <section class="content-header">
                <h1>
                    <span>客户需求匹配页面</span>
                    <small></small>
                </h1>
                <ol class="breadcrumb">
                    <li><a th:href="@{/index}"><i class="fa fa-dashboard"></i>用户中心</a></li>
                    <li><a th:href="@{/demand/showQuery}"><i class="fa fa-dashboard"></i>需求管理</a></li>
                    <li><a href="">需求匹配页面</a></li>
                </ol>
            </section>

            <!-- Main content -->
            <section class="content container-fluid">
                <form th:action=" @{/customer/showDemandMatchedProject}" method="get" id="from1">
                    <input type="hidden" name="pageNo" id="pageNo" />
                    <input type="hidden" name="demandId" th:value="${demand.pid}" />
                    <input type="hidden" name="demandNumber" th:value="${demand.demandNumber}" />
                    <input type="hidden" name="demandName" th:value="${demand.demandName}" />
                    <input type="hidden" name="customerId" th:value="${customer.pid}" />
                    
                     <div th:if="${customer!=null}">
                <b> 客户名称：</b>
                    <a th:href="@{'/customer/customerList?pid='+${customer.pid}}"  th:title="${customer.customerName}" th:text="${#strings.length(customer.customerName)} > 20 ? ${#strings.substring(customer.customerName, 0, 20)}+'...' : ${customer.customerName}"></a>
                    <a class="btn btn-primary" th:href="@{'/customer/hasbeencompared?customerNumber='+${customer.customerNumber}}">已匹配</a><br>
                </div>
                    
                     <div class="form-group">
                     需求名称： <a th:href="@{'/demand/showConditionQuery?searchKeyword=D'+${demand.demandNumber}}"  th:title="${demand.demandName}" th:text="${#strings.length(demand.demandName)} > 10 ? ${#strings.substring(demand.demandName, 0, 10)}+'...' : ${demand.demandName}"></a></span> <a>已匹配</a>
                    </div>
                    
                    <div class="form-group">
                     需求内容： <span th:title="${demand.demandContent}" th:text="${#strings.length(demand.demandContent)} > 10 ? ${#strings.substring(demand.demandContent, 0, 10)}+'...' : ${demand.demandContent}"></span>
                    </div>
                    
                     <div class="form-group">
                        <input style="width: 500px; display: inline" type="text" class="form-control" placeholder="id或名称" name="searchKeyword" th:value="${searchKeyword}">
                    </div>
                    
                     <div class="form-group">
						<label style="font-weight: lighter;"> 
							<input type="radio" name="demandMatch"  checked> 需求匹配项目 
						</label>
						<label style="font-weight: lighter;"> 
							<input type="radio" name="demandMatch" th:value="@{'/person/showCustomerDemandMatchedExpert?customerId='+${customer.pid}+'&pid='+${demand.pid}}"> 需求匹配专家
						</label>
					</div>
                    
                    
                  <!--   <div class="form-group">
                        <label>项目类型</label>
                        <span th:each="ptd : ${projectTypeDictiontryList}">
                            <label style="font-weight: lighter;">
	                            <input type="checkbox" name="projectType" th:value="${ptd.names}" th:text="${ptd.worth}" th:checked="${projectTypedArr != null ? #arrays.contains(projectTypedArr, ptd.names) : false}">
                            </label>
                        </span>
                    </div> -->
                    <div class="form-group">
                        <label>所属领域</label>
                        <span th:each="rfd : ${researchFieldDictiontryList}">
                            <label style="font-weight: lighter;">
	                            <input type="checkbox" name="researchField" th:value="${rfd.names}" th:text="${rfd.worth}" th:checked="${researchFieldArr != null ? #arrays.contains(researchFieldArr, rfd.names) : false}">
                            </label>
                        </span>
                    <button type="submit" class="btn btn-primary" style="margin-left: 40px;">搜索</button>
                    <button type="reset" style="margin-left: 40px;" class="btn btn-primary">重置</button>
                    <input type="button" class="btn btn-primary" value="返回" onclick="window.history.go(-1)" style="margin-left: 40px;">
                    </div>
                    <div>
                        <span class="from-group">
                            <label>国内国外</label>
                            <label style="font-weight: lighter;">
	                            <input type="radio" name="domesticOrForeign" id="optionsRadios1" value="0" th:checked="${project != null ? project.domesticOrForeign == 0 : false}"> 国内
                            </label>
                            <label style="font-weight: lighter;">
	                            <input type="radio" name="domesticOrForeign" id="optionsRadios2" value="1" th:checked="${project != null ? project.domesticOrForeign == 1 : false}"> 国外
                            </label>
                        </span>
                        <span class="form-group form-area">
                            <select class="form-area" id="provinceId">
                                <option value="-1">--选择省--</option>
                                <option th:each="list:${provinceDictiontryList}" th:value="${list.names}" th:text="${list.worth}" th:selected="${list.names eq province}"></option>
                            </select>
                        </span>
                        <span class="form-group form-area">
                            <select class="form-area" id="cityId">
                                <option value="-1">--选择市--</option>
                                <option th:each="list:${cityDictiontryList}" th:value="${list.names}" th:text="${list.worth}" th:selected="${list.names eq city}"></option>
                            </select>
                        </span>
                        <span class="form-group form-area">
                            <select class="form-area" id="areaId">
                                <option value="-1">--选择区--</option>
                                <option th:each="list:${areaDictiontryList}" th:value="${list.names}" th:text="${list.worth}" th:selected="${list.names eq district}"></option>
                            </select>
                        </span>
                        <span class="form-group form-country">
                            <select class="form-area">
                                <option value="-1">--选择国家--</option>
                                <option th:each="list:${countryDictiontryList}" th:value="${list.pid}" th:text="${list.worth}" th:selected="${list.pid eq country}"></option>
                            </select>
                        </span>
                    </div>
                    
                </form>
               
               <br> <br/>
                <div class="box">
                    <div class="box-body"> 
                    <button id="dosubmit" class="btn btn-primary">匹配</button>
                    
                        <table class="table table-bordered">
                            <tbody>
                                <tr>
                                    <th><input id="all" type="checkbox" th:disabled="${not #lists.isEmpty(buttedProjectIdList)}" /></th>
                                    <th>项目id</th>
                                    <th>项目名称</th>
                                    <th>项目类型</th>
                                    <th>项目状态</th>
                                    <th>联系人</th>
                                </tr>
                                <tr th:each="project, stat : ${pageInfo.list}" th:class="${#lists.contains(buttedProjectIdList, project.projectId) ? 'butt-gray' : ''}">
                                    <td><input type="checkbox" class="matched" th:disabled="${#lists.contains(buttedProjectIdList, project.projectId)}" th:value="'demandId='+${demand.pid}+'&demandNumber='+${demand.demandNumber}+'&demandName='+${demand.demandName}+'&projectId='+${project.projectId}+'&projectNumber='+${project.projectNumber}+'&projectName='+${project.projectName}" /></td>
                                    <td >
                                    
                                    <a th:href="@{'/project/showDetail?projectId='+${project.projectId}}" th:text="'R' + ${project.projectNumber}"></a>
                                    
                                    
                                    </td>
                                    <td th:text="${project.projectName}">飞行汽车</td>
                                    <td th:text="${project.projectType}">类型</td>
                                    <td th:text="${project.projectStatus}">状态</td>
                                    <td>
                                        <a th:href="@{'/project/showUpdateContact?projectContactId='+${project.projectContactId == null ? '' : project.projectContactId}}" th:text="${project.projectContactName == null ? '' : project.projectContactName}">联系人</a>
                                    </td> 
                                </tr>
                            </tbody>
                        </table>
                        <p style="color: red;" th:text="${notHolderUpdate}"></p>
                        <p style="color: red;" th:text="${projectContactExists}"></p>
                        <p style="color: red;" th:text="${projectContactNotExists}"></p>
                        <div th:replace="page::html"></div>
                    </div>
                </div>
            </section>
        </div>
        <!-- Main Footer -->
        <div th:replace="footer::html"></div>
        <div class="control-sidebar-bg"></div>
    </div>
    <div th:replace="bottom::html"></div>
    <script type="text/javascript" th:inline="javascript">
        matchButt([[@{/project/demandMatchProject}]]);
    </script>
</body>

</html>